const app = getApp();

Page({
    data: {
        order:{},
        imgUrl: app.globalData.APIURL,
        orderId:'',
    },
    onLoad: function (option) {
        wx.setNavigationBarTitle({
            title: '订单详情'
        })
          this.setData({
              orderId:option.id
          })
        console.log(this.data.orderId)
        this.getItemDetail(option.id);

    },

    getItemDetail:function(id){
        wx.showLoading({
            title: '加载中',
        });
        var that = this;
        wx.request({
            url: app.globalData.APIURL + '/vending-admin/homepage/getItemDetail',
            data: {
                token: app.globalData.token,
                order_id: id,
            },
            // method:'GET',
            header: {
                'content-type': 'application/json' // 默认值
            },
            success: function (res) {
                wx.hideLoading();
                console.log(res.data)
                if (app.requestEro(res.data.success, res.data.msg)) {
                    that.setData({
                        order:res.data.order
                    })
                }

            },
            fail: function (err) {
                console.log(err);
                wx.hideLoading();
            }
        })

    },



});